package com.ljh.bigevent.Enum;

public enum StateEnum {
    success("success",400),
     error("error",401);

    private  String key;
    private  int value;

    StateEnum(String key, int value) {
        this.key=key;
        this.value=value;
    }

    public String getKey() {
        return key;
    }

    public int getValue() {
        return value;
    }
    public int match(String key){
        for (StateEnum message:StateEnum.values()) {
            if(success.getKey().equals(key)){
                return message.getValue();
            }
        }
        return -1;
    }

}
